package com.wang.hashtest;

import java.util.HashMap;
import java.util.Map;

//使用 For Each EntrySet 的方式进行遍历
public class HashMapTest3 {
    public static void main(String[] args) {
        Map<Integer,String > map = new HashMap<>();
        map.put(1,"java");
        map.put(2,"c++");
        map.put(3,"golang");
        map.put(4,"python");
        map.put(5,"php");

        for (Map.Entry<Integer,String > entry: map.entrySet()) {
            System.out.println(entry.getKey());
            System.out.println(entry.getValue());
            }
        }
}
